package com.ys.nms.module.business.dal.mysql.sysLog;

import java.util.*;

import com.ys.nms.framework.common.pojo.PageResult;
import com.ys.nms.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.ys.nms.framework.mybatis.core.mapper.BaseMapperX;
import com.ys.nms.module.business.dal.dataobject.sysLog.SysLogDO;
import org.apache.ibatis.annotations.Mapper;
import com.ys.nms.module.business.controller.admin.sysLog.vo.*;

/**
 * 系统日志 Mapper
 *
 * @author zzy
 */
@Mapper
public interface SysLogMapper extends BaseMapperX<SysLogDO> {

    default PageResult<SysLogDO> selectPage(SysLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SysLogDO>()
                .eqIfPresent(SysLogDO::getDeviceId, reqVO.getDeviceId())
                .eqIfPresent(SysLogDO::getLevel, reqVO.getLevel())
                .eqIfPresent(SysLogDO::getTimestamp, reqVO.getTimestamp())
                .eqIfPresent(SysLogDO::getSeq, reqVO.getSeq())
                .orderByDesc(SysLogDO::getSeq));
    }

}